Flash memories have become increasingly popular in recent years. A typical flash memory comprises a memory array having a large number of memory cells arranged in blocks. Some of the memory cells are fabricated as field-effect transistor having a selection gate and a storage layer. The storage layer is capable of holding charges and is separated from source and drain regions contained in a substrate by a layer of thin oxide. Each of the memory cells can be electrically charged by injecting electrons from the substrate through the oxide layer onto the storage layer. The charges can be removed from the storage layer by tunneling the electrons to the source region. The data in flash memory cells are thus determined by the presence or absence of charges in the storage layers.